package com.youth.youthservice.mapper;

import com.youth.ClientEntity.OrderCourse;
import com.youth.youthservice.entity.EduCourse;
import com.youth.youthservice.entity.vo.CourseVo.CoursePublishVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.youth.youthservice.entity.vo.CourseVo.CourseWebVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 课程 Mapper 接口
 * </p>
 *
 * @author huangqicai,CM
 * @since 2023-5-7
 */
public interface EduCourseMapper extends BaseMapper<EduCourse> {


    /*根据课程id查询课程详情信息
    * 涉及表：edu_course,edu_course_description,edu_teacher,edu_subject
    * */
    CourseWebVo getCourseDetailInfo(String courseId);

    /*根据课程id去查询订单里面的课程信息，用于远程调用-huang*/
    OrderCourse orderCourse(@Param(value = "courseId") String courseId);

    /*根据课程id获取课程的简介信息，讲师信息*/
    CourseWebVo selectInfoWebById(String courseId);

    /*根据课程id查询课程的教师id*/
    @Select("select teacher_id from edu_course where id = #{courseId}")
    String selectTeacherIdByCourseId(String courseId);


    List<String> getCourseIdByTitle(String courseName);
}
